package com.example.tacocloud.bean;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.password.PasswordEncoder;

@Slf4j
@Data
public class RegistrationForm {

    private String userName;
    private String passWord;
    private String fullName;
    private String street;
    private String city;
    private String state;
    private String zip;
    private String phoneNumber;

    public User toUser(PasswordEncoder passwordEncoder) {
        return new User(
                userName, passwordEncoder.encode(passWord),
                fullName, street, city, state, zip, phoneNumber);
    }
}
